<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>v-if与v-show</title>
		<script src="../js/vuejs-2.5.16.js"></script>
	</head>
	<body>
		<div id="app">
			<span v-if="flag">传智播客</span>
			<span v-show="flag">itcast</span>
			<button @click="toggle">切换</button>
		</div>
	</body>
	<script>
		//view model
		new Vue({
			el:"#app",
			data:{
			    flag:false
			},
			methods:{
			    toggle:function () {
					this.flag=!this.flag
                }
			}
		})
	</script>
</html>
